package cate.game.play.skill.active;

import cate.common.util.XT;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.SkillActionCtx;
import cate.game.play.proce.move.AppendMove;

/**
 * 50%概率使用【普通攻击】再次攻击目标/n第1回合释放，冷却4回合
 */
public class 突袭AH extends ActiveHandler{

	private int 概率;

	//概率=5000
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		概率 = args.getInt("概率", 0);
	}

	@Override
	public void onSkillDone(SkillActionCtx action) {
		if(action.getMove().isAppend()){
			return;
		}
		if(!XT.chance(概率)){
			return;
		}
		action.getTurn().addAppend(new AppendMove(skill.owner, skill.owner.skill.getAttack()));
	}
}
